import { Component, OnInit, Injector } from '@angular/core';
import {ActivatedRoute, Router, NavigationEnd} from '@angular/router';
import { AppComponentBase } from '@shared/common/app-component-base';
@Component({
  selector: 'app-device-daily',
  templateUrl: './center-regulation.component.html',
  styleUrls: ['./center-regulation.component.less']
})
export class CenterRegulationComponent extends AppComponentBase implements OnInit {

  tabBelong: string;

  constructor(
    injector: Injector,
    private _activatedRoute: ActivatedRoute,
    private _router: Router) {

    super(injector);
    this._router.events.subscribe(event => {
      if (event instanceof NavigationEnd) {
        this.getPath();
      }
    });
  }

  ngOnInit() {
    this.getPath();
  }

  getPath() {
    this.tabBelong = this._activatedRoute.snapshot.firstChild.routeConfig.data['tabBelong'];
  }

}
